<!-- head -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>弹窗管理</a></li>
            <li class="active"><strong>弹窗新增</strong></li>
        </ol>
    </div>
</div>

<!-- content-->
<div class="wrapper wrapper-content animated fadeIn" ng-controller="popupAddCtrl">
    <form class="form-horizontal" id="form1" name="horizontalCard">
        <div class="form-group">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="row">
                        <div class="ibox-title">
                            <h5>任务基本信息</h5>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>关联业务组:</label>
                            <div class="col-sm-2">
                                <select class="form-control" ng-model="addInfo.businessNo" ng-options="x.value as x.text for x in businessNoList" ng-change="selectAllActivity()">
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>关联活动：</label>
                            <div class="col-sm-3">
                                <select chosen="{width:'100%'}"  class="chosen-select" tabindex="4" ng-model="addInfo.serviceNo" ng-options="x.value as x.text for x in activityList">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>是否弹窗:</label>
                            <div class="col-sm-8 checkbox ">
                                <label ><input type="radio" name="status" ng-model="addInfo.status" value="0" />关闭弹窗</label>
                                <label ><input type="radio" name="status" ng-model="addInfo.status" value="1" />开启弹窗</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">弹窗条件:</label>
                            <div class="col-sm-8 checkbox ">
                               <span>满足当前活动参与条件</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>每日弹窗次数:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="popTimes" required id="popTimes"  ng-model="addInfo.popTimes" ng-pattern="/^(-1|[1-9][0-9]*)?$/" >
                                <div class="req_mesg" ng-show="horizontalCard.popTimes.$dirty && horizontalCard.popTimes.$invalid">
                                    <span ng-show="horizontalCard.popTimes.$error.required">每日弹窗次数不能为空</span>
                                    <span ng-show="horizontalCard.popTimes.$error.pattern">每日弹窗次数格式不符</span>
                                </div>
                            </div>
                            <span style="color:red;padding:7px;display:inline-block;">注:-1为无限次数</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>弹窗时间范围:</label>
                            <div class="col-sm-5">
                                <input id="d5231" class="form-control" type="datetime" ng-model="addInfo.popStartTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5232.focus();},maxDate:'#F{$dp.$D(\'d5232\')}'})"/>
                                ~
                                <input id="d5232" class="form-control" type="datetime"  ng-model="addInfo.popEndTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>弹窗素材:</label>
                            <div class="col-sm-4" >
                                <input type="file" class="checkbox" nv-file-select="" uploader="uploaderImg1" multiple  />
                                <table class="table" class="col-sm-4" >
                                    <tbody>
                                    <tr ng-repeat="item in uploaderImg1.queue">
                                        <td>
                                            <div ng-show="uploaderImg1.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
                                        </td>
                                        <td nowrap>
                                            <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
                                                <span class="glyphicon glyphicon-trash"></span> 删除
                                            </button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>弹窗链接:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="popUrl" required id="popUrl"  ng-model="addInfo.popUrl" >
                                <div class="req_mesg" ng-show="horizontalCard.popUrl.$dirty && horizontalCard.popUrl.$invalid">
                                    <span ng-show="horizontalCard.popUrl.$error.required">弹窗链接不能为空</span>
                                </div>
                            </div>
                            <span style="color:red;padding:7px;display:inline-block;">注:无需跳转填“#”</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>弹窗展示页面:</label>
                            <div  class="col-lg-10" style="padding: 0">
                                <label  class="col-lg-12" style="padding: 5px 15px 0;"/>
                                <div class="col-lg-3" ng-repeat="position in showSelects">
                                    <label><input type="checkbox" ng-true-value="1" ng-false-value="0"  ng-checked="position.checkStatus" ng-model="position.checkStatus" name="name" />{{position.name}}</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="red_req">*</i>优先级排序:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="order"  id="order"  ng-model="addInfo.order" ng-pattern="/^(-1|[1-9][0-9]*)?$/">
                            </div>
                            <div class="req_mesg" ng-show="horizontalCard.order.$dirty && horizontalCard.order.$invalid">
                                <span ng-show="horizontalCard.order.$error.required">优先级排序不能为空</span>
                                <span ng-show="horizontalCard.order.$error.pattern">优先级排序格式不符</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-lg-12 bgff">
                <div class="col-sm-12">
                    <div class="col-lg-3"></div>
                    <div class="col-sm-6">
                        <button class="btn btn-primary btn-mr20" type="button" ng-click="addInfoSubmit()" ng-disabled="horizontalCard.$invalid || submitting">提交</button>
                        <a class="btn btn-primary4" ui-sref="management.taskReward" >返回</a>
                    </div>
                </div>
            </div>
        </div>
    </form>

</div>